
<!--
/**************************************************
* @ unbalancedetailrecvgoods.jsp
*
* Copyright   2006 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/03/19, Jenny Li
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<%@ page import="com.hitrust.gs.bean.GSOrderBean" %>
<%@ page import="java.math.BigDecimal" %>
<html>
<head>
<title>订单查询明细浏览</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<!--<LINK href="<%=root%>/css/css.css" type=text/css rel=stylesheet>-->
<link href="css/caigouxitong.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/hi-check.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<%
	String[] tStr = (String[])request.getAttribute("curorderdetail");
	GSOrderBean tBean = (GSOrderBean)request.getAttribute("orderbean");
	String balanceenddate = (String)request.getAttribute("balanceenddate");
	balanceenddate = balanceenddate.substring(0,4) + balanceenddate.substring(5,7) + balanceenddate.substring(8,10);
%>
<%
if(message == null){
%>
<script language="JavaScript">
	var counter;
	function process(val){
  	    var iFields1 = new Array(5);
        iFields1[0] = 'devGoodsOrderId||送货单号||Y||1-10||##';
        iFields1[1] = 'signer||签收人||Y||1-20||##';
        iFields1[2] = 'goodsUnitprice||价格||Y||1-15||#.';
        iFields1[3] = 'signCount||签收数量||Y||1-15||#.';        
        iFields1[4] = 'contactPerson||送货联系人||N||1-20||##';		
        //iFields1[5] = 'contactPhone||联系电话||N||1-50||#0.';        
        var ary = new Array(9);
		if(val == 'C'){
			if(HiScript.value('orderrecsigngoodsform',iFields1)==false) {
				return false;
			}					
			var date = orderrecsigngoodsform.signDate.value;
			date = date.substring(0,4) + date.substring(5,7) + date.substring(8,10);
			//alert('<%=balanceenddate%>');
			//if(date > <%=balanceenddate%>){
			//	alert("签收日期不能大于系统设定的最大结算日期！");
			//	return false;
			//}
			if(parseFloat(orderrecsigngoodsform.goodsUnitprice.value) > parseFloat(<%=tStr[25]%>)){
				alert("录入的产品价格大于原价格，请重新输入!");
				orderrecsigngoodsform.goodsUnitprice.focus();
				return false;
			}
			var num = orderrecsigngoodsform.signCount.value;
			if(num==0)
			{
				alert("签收数量必须大于0");
				orderrecsigngoodsform.signCount.focus();
				return false;
			}
			if(confirm("是否保存修改信息?")){
				//orderrecsigngoodsform.action = "<%=response.encodeURL(root+"/A150405.do")%>";
				//orderrecsigngoodsform.submit();
				ary[0] = orderrecsigngoodsform.curOrderId.value;
				ary[1] = orderrecsigngoodsform.curOrderDetailId.value;
				ary[2] = orderrecsigngoodsform.devGoodsOrderId.value;
				ary[3] = orderrecsigngoodsform.signer.value;
				ary[4] = orderrecsigngoodsform.signCount.value;
				ary[5] = orderrecsigngoodsform.signDate.value;
				ary[6] = orderrecsigngoodsform.goodsUnitprice.value;
				ary[7] = orderrecsigngoodsform.contactPerson.value;
				ary[8] = orderrecsigngoodsform.contactPhone.value;
				ary[9] = "<%=request.getAttribute("deptCategory")%>"
				ary[10] = "<%=request.getAttribute("deptId")%>"
				ary[11] = "<%=request.getAttribute("balanceYM")%>"
                ary[12] = orderrecsigngoodsform.state.value;
				window.returnValue = ary;
//				window.opener.location.href = window.opener.location.href;
				//window.opener.location.reload(); 
				window.close();
			}else{
				return false;
			}
		}
		
	}

	function calcAmount(){
		if (isEmpty(orderrecsigngoodsform.goodsUnitprice.value) || isNaN(orderrecsigngoodsform.goodsUnitprice.value) ){
			orderrecsigngoodsform.amount.value = "";
			return true;
		} 
		if (isEmpty(orderrecsigngoodsform.signCount.value) || isNaN(orderrecsigngoodsform.signCount.value) ){
			orderrecsigngoodsform.amount.value = "";
			return true;
		}
		
		var scnt = parseFloat(orderrecsigngoodsform.signCount.value,10);
		var gprc = parseFloat(orderrecsigngoodsform.goodsUnitprice.value,2);
		orderrecsigngoodsform.amount.value = Math.round(scnt * gprc * 10000)/10000;
		return true;
	}
</script>
</head>
<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<form name="orderrecsigngoodsform" method="post" >
<input type="hidden" name="curOrderId" value="<%=tBean.getGs_order_tempid() %>">
<input type="hidden" name="curOrderDetailId"  value="<%=tStr[0]%>">
<input type="hidden" name="state"  value="<%=tStr[15]%>">
<p><br></p>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td height="20">
			<table width="100%" border="0" cellspacing="0" cellpadding="1">
				<tr height="20">
					<td height="30" width="758" class="mtxt_black">订单信息
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td class="bg_line" height="2"></td>
	</tr>
</table>
<br>
	<center>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
    <td>
    <table class=bg_table id=tableId	cellspacing=1 cellpadding=0 width=100% align=center border=0>
    <tbody>
	<tr class="bg_row_odd" height="20">
		<td class="top" align="center" width='20%' id='aaa'><div align="center" class="txt_content">订单编号</div></td>
		<td  colspan=5 class="top" width="30%"><div class="txt_content">&nbsp;<%=tBean.getGs_order_tempid()%></div></td>
	</tr>
	<tr class="bg_row_odd" height="20">
	<td class="top" width="13%" align="center">订货单位</td>
	<td class="top" width="20%"><div class="txt_content" align="left">&nbsp;<%=GSBaseManager.getOrderDeptName(tBean.getGs_workcorp_id())%></div></td>
	<td class="top" width="13%" align="center">配送方式</td>
	<td class="top" width="20%"><div class="txt_content" align="left">&nbsp;<%=tBean.getGs_deliver_mode()==null? "":GSBaseManager.getDeliverModeName(tBean.getGs_deliver_mode())%></div></td>
	<td class="top" width="13%" align="center">结算方式</td>
	<td class="top"><div class="txt_content" align="left">&nbsp;<%=tBean.getGs_balance_mode() == null? "":GSBaseManager.getBalanceModeName(tBean.getGs_balance_mode())%></div></td>
	</tr>
	<tr class="bg_row_odd" height="20">
	<td class="top" width="13%" align="center">送货地址</td>
	<td class="top"><div class="txt_content" align="left">&nbsp;<%=tBean.getGs_deliver_goods_addr()%></div></td>	
	<td class="top" width="13%" align="center">联系人</td>
	<td class="top"><div class="txt_content" align="left">&nbsp;<%=tBean.getGs_order_contact_name()==null?"":tBean.getGs_order_contact_name()%></div></td>	
	<td class="top" width="13%" align="center">联系电话</td>
	<td class="top"><div class="txt_content" align="left">&nbsp;<%=tBean.getGs_order_contact_phone()==null?"":tBean.getGs_order_contact_phone()%></div></td>	
	</tr>
	<tr class="bg_row_odd" height="50">
	<td class="top" width="13%" align="center">备注</td>
	<td class="top" colspan=5><div class="txt_content" align="left">&nbsp;<%=tBean.getGs_notes()%></div></td>	
	</tr>
	<tr class=bg_row_odd >
	<td class="top" width="13%" align="center">创建人</td>
	<td class="top"><div class="txt_content">&nbsp;
		
		<%
		com.hitrust.gs.bean.GSOperatorBean operatorBean = null;
		com.hitrust.gs.dao.GSOperatorDAO operatorDao = new com.hitrust.gs.dao.GSOperatorDAO();
		if (tBean.getGs_recorder_id() != null && !tBean.getGs_recorder_id().equalsIgnoreCase(""))
		{
			operatorBean = operatorDao.queryOperById(tBean.getGs_recorder_id());
			if (operatorBean == null ) operatorBean = new com.hitrust.gs.bean.GSOperatorBean();
		}	
		%>
		<%=operatorBean.getGs_oper_name()%>
		
		</div>
	</td>	
	<td class="top" width="13%" align="center">创建时间</td>
	<td class="top" colspan=3><div class="txt_content">&nbsp;<%=tBean.getGs_order_create_date()%></div></td>	
	</tr>
	</tbody>
	</table>
	<br>
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20> 
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">订单明细编号</div>
						</td>                    
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">集中编码</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">产品名称</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">是否网上产品</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">规格</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">型号</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">品牌</div>
						</td>
                       <td class=top align=middle> 
                        <div align="center" class="txt_content">供应商</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">订货数量</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">单位</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">价格（元）</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">总价（元）</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">送货日期</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">送货时间</div>
						</td>																																																																				
					</tr>
							<tr height=20 class="bg_row_odd">
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[0]%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[1]%>
									</div>
								</td>								
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root+"/A150103.do")%>?&concentricityId=<%=tStr[1]%>" target="_blank"><%=tStr[2]%></a>
									</div>
								</td>
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=GSBaseManager.getIsTradeManuf(tStr[15])%>
									</div>
                                    
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[3]%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[4]%>
									</div>
								</td>						
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[5]%>
									</div>
								</td>								
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%
										String temp = "";
										if(tStr[15].equals("0") && tStr[16].equals("0")){
										    temp = "(采购网配送)";
										}
									%>
									<a href="<%=response.encodeURL(root + "/A400108.do?providerId="+tStr[14])%>" target="_blank"><%=tStr[6]%></a><%=temp%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[7]%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[8]%>
									</div>
								</td>									
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[25]%>元
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[10]%>元
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[11]%>
									</div>
								</td>																									
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[12]%>
									</div>
								</td>																			
							</tr> 				
						</tbody>
					</table>	
					
				<table class="bg_table" id="tableId1" cellspacing="1" cellpadding="2" width="100%" align="center" border="0">
					<tbody>
					<tr class="bg_row_odd" height="20">
						<td class=top colspan=4> 
							<b>当前订单明细送货信息</b>
						</td>
					</tr>
					<tr class="bg_row_odd" height="20">					
						<td width="33%">
						<div align="center" class="txt_content">						
						送货单号
						</div>
						</td>
						<td width="13%">
						<div align="center" class="txt_content">
							<%=tStr[23]%>
						</div>	
						</td>
						<td width="21%">
						<div align="center" class="txt_content">												
						送货时间
						</div>
						</td>
						<td width="33%">
						<div align="center" class="txt_content">												
						<%=tStr[11] + " " + tStr[12]%>
						</div>
						</td>
					</tr>
					<tr class="bg_row_odd" height="20">					
						<td width="33%">
						<div align="center" class="txt_content">						
						送货联系人
						</div>
						</td>
						<td width="13%">
						<div align="center" class="txt_content">						
						<%=tStr[20]%>
						</div>
						</td>
						<td width="21%">
						<div align="center" class="txt_content">						
						联系电话
						</div>
						</td>
						<td width="33%">
						<div align="center" class="txt_content">						
						<%=tStr[21]%>
						</div>
						</td>
					</tr>
					<tr class="bg_row_odd" height="20">					
						<td>
						<div align="center" class="txt_content">												
						配送数量
						</div>
						</td>
						<td>
						<div align="center" class="txt_content">												
						<%=tStr[24] %><%=tStr[8]%>
						</div>
						</td>
						<td>
						<div align="center" class="txt_content">												
						送货信息录入时间
						</div>
						</td>
						<td>
						<div align="center" class="txt_content">												
						<%=tStr[22] %>
						</div>
						</td>
					</tr>
				</tbody>
				</table>
				<table class="bg_table" id="tableId2" cellspacing="1" cellpadding="2" width="100%" align="center"
					border="0">
					<tr class="bg_row_odd" height="20">
						<td class="top" colspan="6">
							<b>当前订单明细收货信息</b>
						</td>
					</tr>
					<tr class="bg_row_odd" height="20">
						<td class="top" align="center" width="13%">
							<div align="center" class="txt_content">送货单号</div>
						</td>
						<td class="top" align="center" width="20%">
							<div align="left" class="txt_content">
							<INPUT type="text" name="devGoodsOrderId" maxlength="20" value="<%=tStr[23]%>"><font color=red>*</font>
							</div>
						</td>
						<td class="top" align="center" width="13%" >
							<div align="center" class="txt_content">签收人</div>
						</td>
						<td class="top" align="center" width="20%">
							<div align="left" class="txt_content">
								<input name='signer' type="text" maxlength="20" value="<%=tStr[17]%>"><font color=red>*</font>
							</div>
						</td>
						<td class="top" align="center" width="13%">
							<div align="center" class="txt_content">签收日期</div>
						</td>
						<td class="top" align="center" width="20%">
							<div align="left" class="txt_content">
								<input name='signDate' readonly onfocus='setday(this)' value="<%=tStr[19]%>">
							</div>
						</td>
					</tr>
					<tr class="bg_row_odd" height="20">
						<td class="top" align="center" width="13%" >
							<div align="center" class="txt_content">价格</div>
						</td>
						<td class="top" align="center" width="20%">
							<div align="left" class="txt_content">
							<INPUT type="text" name="goodsUnitprice" maxlength="15" size=10 value="<%=tStr[9]%>"
							 onKeyUp="calcAmount()" >（元）<font color=red>*</font>
							</div>
						</td>
						<td class="top" align="center" width="13%" id='aaa'>
							<div align="center" class="txt_content">签收数量</div>
						</td>
						<td class="top" align="center" id='bbb' >
							<div align="left" class="txt_content">
								<input name='signCount' type="text" maxlength="15" value="<%=tStr[18]%>"
								  onKeyUp="calcAmount()"><%=tStr[8]%><font color=red>*</font>
							</div>
						</td>
						<td><div align="center" class="txt_content">金额(元)</div></td>
						<td>
						 <div align="left" class="txt_content">
						 		<%
								String sAmt = "";
						        try {
						            BigDecimal dprc = new BigDecimal(tStr[9]);
						            BigDecimal dcnt = new BigDecimal(tStr[18]);
						            sAmt = dprc.multiply(dcnt).toString();
						        }
						        catch (Exception e) {						            
						        }
								%>
								<input name='amount' type="text" maxlength="15" value="<%=sAmt%>" readonly>
						 </div>
						</td>
					</tr>
					<tr class="bg_row_odd" height="20">
						<td class="top" align="center" width="13%" id='aaa'>
							<div align="center" class="txt_content">送货联系人</div>
						</td>
						<td class="top" align="center" width="20%">
							<div align="left" class="txt_content">
							<INPUT type="text" name="contactPerson" maxlength="20" value="<%=tStr[20]%>">
							</div>
						</td>
						<td class="top" align="center" width="13%">
							<div align="center" class="txt_content">联系电话</div>
						</td>
						<td class="top" align="center" colspan="3">
							<div align="left" class="txt_content">
								<input type="text" name="contactPhone" maxlength="50" value="<%=tStr[21]%>">
							</div>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	</center>
</form>
    <p align="center">  
<!--		<input type="image" src="images/button/guanbi.gif" width="58" height="24" class="box" onclick="window.close();"/>&nbsp;		-->
		<input type="button" name="确定" value="确定" onClick="process('C')" class="kuang">
		<input type="button" name="取消" value="取消" onClick="window.close()" class="kuang">		
    </p>
 <%
}
 %>
</html>